<div class="wrap">

{if $smarty.cookies.message == null}
	<div id="ajaxResponse1" class="ajaxResponse"></div>
{else}
	<div id="ajaxResponse1" class="ajaxResponse fade" style="display:block">{$smarty.cookies.message}</div>
{/if}
<h2>{TranslateTag}B_LABEL_INCOMING_ORDER{/TranslateTag}</h2>
	<table class="widefat">
		<thead>
		<tr>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=so_id&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_ID{/TranslateTag}</th>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=orders_date_finished&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_ORDER_DATE{/TranslateTag}</th>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}" width="10%"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=customer_firstname&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_CUSTOMER_NAME{/TranslateTag}</th>
	        <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=customer_email&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_CUSTOMER_EMAIL{/TranslateTag}</th>
	        <th scope="col" width="35%">{TranslateTag}B_LABEL_PRODUCT{/TranslateTag}</th>
	        <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=currency_value&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_TOTAL{/TranslateTag}</th>
            <th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1={$smarty.get.sub1}{/if}&sort=pay_status&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_PAID{/TranslateTag}</th>
	        <th width="10%" colspan="3" style="text-align: center">{TranslateTag}B_LABEL_ACTION{/TranslateTag}</th>
		</tr>
		</thead>
		<tbody id="incomingordertable">
			{foreach name=incomingorder from=$INCOMING_ORDER.data item=item}
				<tr id="row_{$item->so_id}" class="{cycle values=,alternate}">
					<th scope='row' width="5%" style='text-align: left'>{$item->so_id}</th>
					<td width="10%">{$item->orders_date_finished}</td>
					<td width="15%">{$item->customer_firstname} {$item->customer_lastname}</td>
					<td width="10%">{$item->customer_email}</td>
					<td width="35%">
                    	<table width="100%" cellpadding="0" cellspacing="0">
                            {foreach name=search from=$item->product item=product}
                            <tr>
                                <td width="10%" align="right">{$product->product_quantity} </td>
                                <td width="10%" >&nbsp;x&nbsp;</td>
                                <td align="left">{smarty_eval code=$product->product_name|truncate:30}</td>
                            </tr>    
                            {/foreach}
                        </table>
                    </td>
                    <td align="center">{$item->currency_value} {$item->symbol_left}</td>
                    <td align="center">
                    	<input type="checkbox" value="1" name="paid{$item->so_id}" id="paid{$item->so_id}" onclick="onChangePaid('?module={$smarty.get.module}&sub1={$smarty.get.sub1}','{$item->so_id}',this,'ajaxResponse1')" {if $item->pay_status eq '1' }checked="checked"{/if}/>
                    	
                    </td>
                    <td style="text-align: center">
                    	<a onclick="onSendPDF('?{$smarty.server.QUERY_STRING}', '{$item->so_id}', 'ajaxResponse1')" 
						class='edit'><img src="../view/admin/images/object_pdf.png" alt="Edit" /></a></td>
					<td style="text-align: center">
                    	<a href="?module={$smarty.get.module}&sub1=incomingorder&act=editincomingorder&id={$item->so_id}" 
						class='edit'><img src="../view/admin/images/object_edit.png" alt="Edit" /></a></td>
					<td style="text-align: center">
						<a onclick="onDeleteInComingOrder('?{$smarty.server.QUERY_STRING}', '{$item->so_id}', 'ajaxResponse1')" 
						class='delete'><img src="../view/admin/images/object_delete.png" alt="Delete" /></a></td>
				</tr>
			{/foreach}
		</tbody>
	</table>
	{if $INCOMING_ORDER.data != NULL}
     <div>			
      <div style="width:300px; float:left"> 
          {TranslateTag}LABEL_PAGES{/TranslateTag} : {$INCOMING_ORDER.TOTAL} {TranslateTag}LABEL_OF{/TranslateTag} {$INCOMING_ORDER.TOTALDATA}
      </div>			
      <div style="width:300px; text-align:right; float:right" >{$INCOMING_ORDER.FIRST} {$INCOMING_ORDER.PRE}&nbsp;{$INCOMING_ORDER.LISTPAGE} {TranslateTag}LABEL_OF{/TranslateTag} &nbsp; {$INCOMING_ORDER.TOTALPAGE} &nbsp;                   
          <select onchange="javascript:window.location='{$INCOMING_ORDER.LINK}&{$INCOMING_ORDER.PATHNAME}='+this.value">
            {$INCOMING_ORDER.COMBOPAGE}                     
          </select>&nbsp;{$INCOMING_ORDER.NEXT} {$INCOMING_ORDER.LAST}         
      </div>
      <div style="clear:both"></div>		
    </div>	     
    {/if}
</div>